﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Shapes;
using MockupDesigner.Editors;
using MockupDesigner.Items;

namespace MockupDesigner.AppItems
{
    public class DesignerService
    {
        public ItemEditor GetEditor(ItemBase item)
        {
            object[] attributes = item.GetType().GetCustomAttributes(typeof(ItemEditor), true);
            if (attributes.Length == 0)
            {
                return null;
            }
            ItemEditor editor = attributes[0] as ItemEditor;
            editor.SetItem(item);
            return editor;
        }
    }
}
